package com.hqhsc.module.manage.activity.controller;

import com.hqhsc.module.front.activity.service.VoteService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Properties;

@Controller
@RequestMapping("/manage/activity/vote")
public class VoteManageController {
	final Logger logger = LoggerFactory.getLogger(VoteManageController.class);

    @Autowired
    private VoteService voteService;

	@Autowired
	private Properties appProps;

    /**
     * 设计大赛-首页
     * @param model
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/design/index" , method = RequestMethod.GET)
    public String designIndex(Model model , HttpServletRequest request , HttpServletResponse response) {
        return "/module/front/activity/vote/design/index";
    }

    /**
     * 设计大赛-详情页
     * @param model
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/design/detail" , method = RequestMethod.GET)
    public String designDetail(Model model , HttpServletRequest request , HttpServletResponse response) {

        return "/module/front/selectionvote/design/detail";
    }

    /**
     * 入围作品列表
     * @param model
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/design/productlist" , method = RequestMethod.GET)
    public String productList(Model model , HttpServletRequest request , HttpServletResponse response) {

        return "/module/front/selectionvote/design/productlist";
    }


    /**
     * 作品详情页
     * @param model
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/design/productdetail" , method = RequestMethod.GET)
    public String productDetail(Model model , HttpServletRequest request , HttpServletResponse response) {

        return "/module/front/selectionvote/design/productdetail";
    }

    /**
     * 投票
     * @param model
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/vote" , method = RequestMethod.GET)
    public int doVote(Model model , HttpServletRequest request , HttpServletResponse response) {

        return 0;
    }



//    /**
//     * 用户报名
//     * @param model
//     * @param request
//     * @param response
//     * @return
//     */
//    @RequestMapping(value = "/dosignup" , method = RequestMethod.POST)
//    @ResponseBody
//    public int doSignUp(Model model , HttpServletRequest request , HttpServletResponse response) {
//
//        String edited_user_id = request.getParameter("edited_user_id");
//        String real_name = request.getParameter("user_name");
//
//
//        return this.activityUserService.signupActivityUser();
//    }
}